import java.util.Random;
import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        int count=0;
        Random r =new Random();
        int x = r.nextInt(100)+1;
        Scanner SC =new Scanner(System.in);
        while (true){
            System.out.println("请输入你要猜的数字");
            int num = SC.nextInt();
            count++;
            if (count==3){
                System.out.println("猜对了");
                break;}
            if (num>x){
                System.out.println("大了");
            }
            else if (num<x){
                System.out.println("小了");
            }
            else {
                System.out.println("猜对了");
            }}

    }
}
